import request from '@/utils/request.js';

export const getAllChannels = () => {
  return request({
    method: 'GET',
    url: '/v1_0/channels',
  });
};

// 批量修改用户频道列表，这个请求用于在用户已登录的状态下，将用户的频道数据持久化
export const addUserChannels = (channels) => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels: [channels],
    },
  });
};

// 批量修改用户频道列表，这个请求用于在用户已登录的状态下，将用户的频道数据持久化
export const deleteMyChannels = (channelId) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/user/channels/${channelId}`,
  });
};
